#include "RELogger.h"

static RE_Logger g_Logger("global.log");
RE_Logger * const RE_Logger::GetGlobalLogger()
{
	return &g_Logger;
}

RE_Logger::RE_Logger(const TCHAR * const file_location)
{
	m_file.open(file_location);
}
RE_Logger::RE_Logger(const char * const file_location)
{
	m_file.open(file_location);
}
RE_Logger::~RE_Logger()
{
	if(m_file.is_open())
	{
		m_file.close();
	}
}

void RE_Logger::WriteLog(const char * const str)
{
	if(m_file.is_open())
	{
		m_file << str << std::endl;
	}
}
void RE_Logger::Log(const char * const str)
{
	if(m_file.is_open())
	{
		m_file << str; 
	}
}
bool RE_Logger::CanWriteLog()
{
	return m_file.is_open();
}